package edu.vt.ece.rt.benchmark.vacation;

import edu.vt.ece.rt.dstm.QObject;
import edu.vt.ece.rt.quorum.Resource;

public class Hotel extends Travel {

	public Hotel(String ID, int p, int t, int u) {
		id = ID;
		price = p;
		total = t;
		used = u;
		Resource.putQObject(getId(), this);
	}
	
	public Hotel() {
		
	}
	
	
	@Override
	public QObject clone() {
		Hotel c = new Hotel();
		c.setId(getId());
		c.setPrice(getPrice());
		c.setTotal(getTotal());
		c.setUsed(getUsed());
		c.setCloneOwner(getCloneOwner());
		c.setVersion(getVersion());
		return c;
	}


	public boolean isAvailable() {
		return (total - used) > 0;
	}

	public void reserve() {
		used++;
	}

}
